/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.xtd.model.retail;

import com.xtd.model.inventory.DressSuit;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Lu Yuanbin
 */
@Entity
@Table(name = "order_dress_suit")
@NamedQueries({
    @NamedQuery(name = "OrderDressSuit.findAll", query = "SELECT o FROM OrderDressSuit o"),
    @NamedQuery(name = "OrderDressSuit.findById", query = "SELECT o FROM OrderDressSuit o WHERE o.id = :id"),
    @NamedQuery(name = "OrderDressSuit.findByReturnDate", query = "SELECT o FROM OrderDressSuit o WHERE o.returnDate = :returnDate"),
    @NamedQuery(name = "OrderDressSuit.findByRental", query = "SELECT o FROM OrderDressSuit o WHERE o.rental = :rental")})
public class OrderDressSuit implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "return_date")
    @Temporal(TemporalType.DATE)
    private Date returnDate;
    @Column(name = "rental")
    private BigDecimal rental;
    @JoinColumn(name = "order_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private ShootingOrder shootingOrder;
    @JoinColumn(name = "dress_suit_id", referencedColumnName = "id")
    @OneToOne(optional = false)
    private DressSuit dressSuit;

    public OrderDressSuit() {
    }

    public OrderDressSuit(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getReturnDate() {
        return returnDate;
    }

    public void setReturnDate(Date returnDate) {
        this.returnDate = returnDate;
    }

    public BigDecimal getRental() {
        return rental;
    }

    public void setRental(BigDecimal rental) {
        this.rental = rental;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrderDressSuit)) {
            return false;
        }
        OrderDressSuit other = (OrderDressSuit) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.xtd.model.retail.OrderDressSuit[id=" + id + "]";
    }


    /**
     * @return the dressSuit
     */
    public DressSuit getDressSuit() {
        return dressSuit;
    }

    /**
     * @param dressSuit the dressSuit to set
     */
    public void setDressSuit(DressSuit dressSuit) {
        this.dressSuit = dressSuit;
    }

    /**
     * @return the shootingOrder
     */
    public ShootingOrder getShootingOrder() {
        return shootingOrder;
    }

    /**
     * @param shootingOrder the shootingOrder to set
     */
    public void setShootingOrder(ShootingOrder shootingOrder) {
        this.shootingOrder = shootingOrder;
    }
}
